#ifndef CAR__H_
#define CAR__H_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
	FORWARD = 0,
	BACKWARDS,
} car_driect;

typedef struct _car_ctrl_t {
	car_driect direct;
	int angle;	
} car_ctrl_t;


typedef enum{
	START = 0,
	STANDBY,
	ROUND,
	SEARCH,
	STOP,
} car_status_t;

typedef enum{
	STRAIGHT = 0,
	GOING,
	TURNNING,
} car_sub_status_t;


#define front(v)     gpio_output(1, 16, v)
#define behind(v)    gpio_output(1, 17, v)
#define left(v)      gpio_output(1, 18, v)
#define right(v)     gpio_output(1, 20, v)
#define stop(v)      //gpio_output(1, 20, v)


int car_ctrl_change(car_status_t ctrl);
car_status_t get_car_ctrl(void);
void car_init(void);
int goin_round(void);


#ifdef __cplusplus
}
#endif

#endif /* CO_VCI__H_ */

